package redis.datatype.impl;

import redis.clients.jedis.ShardedJedis;
import redis.datatype.ICommon;

public class ICommonImpl implements ICommon {

	public boolean isExists(ShardedJedis jedis, String key) {
		return jedis.exists(key);
	}

	public long getEffectiveTime(ShardedJedis jedis, String key) {
		return jedis.ttl(key);
	}

	public long setExpireTime(ShardedJedis jedis, String key, long seconds) {
		return jedis.expire(key, (int) seconds);
	}

	public long setExpireTimeAt(ShardedJedis jedis, String key, long unixTime) {
		return jedis.expireAt(key, unixTime);
	}

}
